<template>
  <div>
    <!-- 三级导航 -->
    <TypeNav></TypeNav>
    <!-- 轮播图 -->
    <ListContainer></ListContainer>
    <!-- 今日推荐 -->
    <Recommend></Recommend>
    <!-- 商品排行  -->
    <Rank></Rank>
    <Like></Like>
    <!-- 楼层 -->
    <Floor
      v-for="floor in floorsList"
      :key="floor.id"
      :floor="floor"
      :cname="'floor-swiper' + floor.id"
    ></Floor>
    <!-- 品牌 -->
    <Brand></Brand>
  </div>
</template>

<script>
// import TypeNav from './TypeNav'
import ListContainer from './ListContainer'
import Recommend from './Recommend'
import Rank from './Rank'
import Floor from './Floor'
import Like from './Like'
import Brand from './Brand'
import { mapState } from 'vuex'
export default {
  name: 'Home',
  components: {
    // TypeNav,
    ListContainer,
    Recommend,
    Rank,
    Floor,
    Like,
    Brand,
  },
  computed: {
    // ...mapState(['floorsList'])

    // 开启模块化后的引用方式
    ...mapState('home', ['floorsList']),
  },
  mounted() {
    // this.$store.dispatch('getFloorsListData')

    // 开启模块化后的方法方式
    this.$store.dispatch('home/getFloorsListData')
  },
}
</script>

<style></style>
